package com.iflyings.android.component

import java.io.Serializable

internal object EmptyComponentContext : ComponentContext, Serializable {
    private fun readResolve(): Any = EmptyComponentContext

    override fun <R> fold(initial: R, operation: (R, ComponentContext.Element) -> R) = initial
    override fun <E : ComponentContext.Element> first(operation: (E) -> Boolean) = null

    override fun plus(context: ComponentContext) = context
    override fun minusKey(key: ComponentContext.Key<*>) = this
    override fun hashCode() = 0
    override fun toString() = "EmptyComponentContext"
}